package com.admin.core.entity;

import com.admin.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 角色
 *
 * @author sq-lan
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SysRole extends BaseEntity implements Serializable {

    @NotNull(groups = {Update.class})
    @ApiModelProperty(value = "ID", hidden = true)
    private Integer id;

    @NotBlank
    @ApiModelProperty(value = "名称", hidden = true)
    private String name;

    @ApiModelProperty(value = "数据权限")
    private Integer dataScope;

    @ApiModelProperty(value = "所属部门")
    private Integer deptId;

    @ApiModelProperty(value = "描述")
    private String description;


    @TableField(exist = false)
    @ApiModelProperty(value = "菜单", hidden = true)
    private List<SysMenu> menus;

    @TableField(exist = false)
    @ApiModelProperty(value = "部门", hidden = true)
    private List<SysDept> departments;
}
